<h1>Pregled naročila</h1>
<?php $configHelper = $this->getHelper('Config'); ?>
<?php $kosaricaHelper = $this->getHelper('Kosarica'); ?>
<?php /* @var $narocilo Application_Model_Narocilo */ ?>
<?php $narocilo = $this->narocilo; ?>
<?php $stranka = new Application_Model_Stranka(); ?>
<?php $strankaMapper = new Application_Model_StrankaMapper(); ?>
<?php $strankaMapper->find($narocilo->getStranka_emso(), $stranka); ?>
<div id="view-content">

	<div class="uporabnik">
		<h3>Podatki za dostavo in plačilo</h3>
		<ul>
			<li><b>Ime in priimek:</b> <?php echo $stranka->getIme()." ".$stranka->getPriimek() ?></li>
			<li><b>Email:</b> <?php echo $stranka->getEmail() ?></li>
			<li><b>Naslov:</b> <?php echo $stranka->getNaslov() ?></li>
			<li><b>Telefon:</b> <?php echo $stranka->getTelefon() ?></li>
		</ul>
	</div>

	<h3>Izdelki na naročilu</h3>
	<?php $kosarica = $kosaricaHelper->getIzdelki($narocilo->getKosarica_sifra_kosarice()); ?>
	<table id="kosarica-grid" class="table">

		<tr>
			<th>Ime izdelka:</th>  <th>Kolicina:</th> <th>Cena izdelka:</th><th>Skupna cena:</th>
		</tr>

		<?php foreach ($kosarica as $kosara): ?>
			<tr>

				<td><?php echo $kosara['izdelek']->getIme();  ?></td>
				<td><?php echo $kosara['kolicina'];?></td>
				<td><?php echo number_format($kosara['izdelek']->getCena(),2);?> <?php echo $configHelper->getCurrencySymbol() ?></td>
				<td><?php echo number_format($kosara['izdelek']->getCena() * $kosara['kolicina'],2) ?> <?php echo $configHelper->getCurrencySymbol() ?></td>

			</tr>
		<?php endforeach; ?>
		<tr>

		</tr>
		<?php $koncni=0 ?>
		<?php foreach ($kosarica as $kosara): ?>
			<?php $koncni += $kosara['izdelek']->getCena() * $kosara['kolicina']?>

                </tr>
        <?php endforeach; ?>
		<th>Končen znesek nakupa:</th> <th></th> <th></th>
		<td><?php echo number_format($koncni,2)?> <?php echo $configHelper->getCurrencySymbol() ?></td>
		<tr>

	</table>
</div>